<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateAddressTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('address', function(Blueprint $table)
		{
			$table->increments('address_id')->comment('用户地址id');
			$table->integer('user_id')->comment('用户id');
			$table->string('consignee', 60)->comment('收货人');
			$table->string('country', 60)->nullable()->default('中国')->comment('国家');
			$table->string('position_ids', 32)->comment('省市区id集');
			$table->string('province', 60)->comment('省');
			$table->string('city', 60)->comment('市');
			$table->string('district', 120)->comment('街道');
			$table->string('address', 120)->comment('地址');
			$table->string('mobile', 60)->comment('手机');
			$table->boolean('is_default')->nullable()->default(0)->comment('是否为默认');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('address');
	}

}
